package com.starmark.gateway.auth.provider.mapper;


import com.starmark.core.framework.base.SuperMapper;
import com.starmark.gateway.auth.provider.entity.GatewayAuthResource;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * 系统菜单 Mapper 接口
 * </p>
 *
 * @author starmark
 * @since 2019-04-21
 */
@Mapper
public interface GatewayAuthResourceMapper extends SuperMapper<GatewayAuthResource> {


    /**
     * 通过角色ID,查找对应的角色数据
     *
     * @param roles 角色编码数据
     * @return 角色编码集合
     */
    Set<String> getMenuIdsByRoles(@Param("roles") Set<String> roles);


    /**
     * 通过组织ID,查找相关权限资源ID
     *
     * @param orgIds 组织ID集合
     * @return 权限编码
     */
    Set<String> getPermissionIdsByOrgId(@Param("orgIds") List<String> orgIds);

}